package com.zrrd.mybatis_02.mapper;

import com.zrrd.mybatis_02.entity.Student;
import com.zrrd.mybatis_02.getSql.StudentSQL;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author WanJl
 * @version 1.0
 * @title StudentMapper
 * @description
 * @create 2024/10/17
 */
public interface StudentMapper02 {
    @SelectProvider(type = StudentSQL.class,method = "getSelectAll")
    @Results({
            @Result(column = "name",property = "studentName"),
            @Result(column = "age",property = "studentAge"),
    })
    List<Student> selectAll();

    @InsertProvider(type = StudentSQL.class,method = "getInsert")
    Integer insert(Student student);

    @UpdateProvider(type = StudentSQL.class,method = "getUpdate")
    Integer update(Student student);

    @DeleteProvider(type = StudentSQL.class,method = "getDelete")
    Integer delete(Integer id);

    @SelectProvider(type = StudentSQL.class,method = "getSelectByCondition")
    List<Student> selectCondition(Student student);
}
